import Vue from "vue";
import VueI18n from "vue-i18n";
import enLocale from "element-ui/lib/locale/lang/en";
import zhLocale from "element-ui/lib/locale/lang/zh-CN";
import userZhLocale from "./zh";
import userEnLocale from "./en";

Vue.use(VueI18n);

const messages = {
  en: {
    ...userEnLocale,
    ...enLocale,
  },
  zh: {
    ...userZhLocale,
    ...zhLocale,
  },
};

// this.$i18n.locale = "zh";更改语言
// Create VueI18n instance with options
const i18n = new VueI18n({
  locale: "zh", // set locale
  messages, // set locale messages
});
export default i18n;
